<%@ page pageEncoding="utf-8"    isELIgnored="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="path" value="${pageContext.request.contextPath}"/>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  
    <title>My JSP 'MyJsp.jsp' starting page</title>
    
	

  </head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>


<script type="text/javascript" src="/dangdang_zjs/ceshi1/js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="/dangdang_zjs/ceshi1/js/jquery.validate.js"></script>
<script type="text/javascript" src="/dangdang_zjs/ceshi1/js/message_zh_CN.js"></script>


<script type="text/javascript">
	$(function(){
		// 传入 校验规则
		$("form").validate({
			rules :{
				username : {required:true,email:true},
			
				password : {required: true, minlength:5}, 
				repassword : {required: true, minlength:5, equalTo: '#password'}
			},
			errorPlacement:function(error,element){
				     element.next().append(error);
					//element.before(error);
			}
		});
	});
	
	  
	
	
	
</script>
  
  <body>
  <!-- 将校验规则写入html元素-->
<form>
	用户名 <input type="text" name="username" id="username"/><span></span><br/>
	户名 <input type="text" name="nick_name" id="nick_name"/><span></span><br/>
	密码 <input type="password" name="password" id="password"/><span></span><br/>
	确认密码 <input type="password" name="repassword" id="repassword"/><span></span><br/>
	<input type="submit" value="注册" /> 
</form> 
  
  </body>
</html>
